public class Test {
    public static void main(String[] args) {
        String s="hello, my name is Jone";
        int count=1;
        for (int i = 0; i <s.length() ; i++) {
            if(s.charAt(i)==' '){
                count++;
            }
        }
        System.out.println(count);
    }
}
